<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><%= error.status || '错误' %></title>
    <link href="https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap" rel="stylesheet">
    <style>
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }
        body {
            font-family: 'M PLUS Rounded 1c', sans-serif;
            background-color: #f0f0f0;
            color: #333;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-image: url('/images/anime-bg.jpg');
            background-size: cover;
            background-position: center;
            animation: fadeIn 0.5s ease-in-out;
        }
        .error-container {
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            padding: 40px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
            text-align: center;
            max-width: 600px;
            backdrop-filter: blur(5px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            animation: float 3s ease-in-out infinite;
        }
        h1 {
            color: #ff4d4d;
            font-size: 3em;
            margin-bottom: 20px;
        }
        h2 {
            color: #666;
            font-size: 1.5em;
            margin-bottom: 30px;
        }
        .anime-character {
            width: 200px;
            margin: 0 auto 20px;
        }
        .error-details {
            background-color: #f8f8f8;
            padding: 15px;
            border-radius: 5px;
            margin-top: 20px;
            text-align: left;
            font-family: monospace;
            max-height: 200px;
            overflow-y: auto;
        }
        .home-button {
            display: inline-block;
            margin-top: 30px;
            padding: 12px 25px;
            background: linear-gradient(135deg, #ff6b6b, #ff4d4d);
            color: white;
            text-decoration: none;
            border-radius: 50px;
            transition: all 0.3s;
            font-weight: bold;
            letter-spacing: 1px;
            box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
            position: relative;
            overflow: hidden;
        }
        .home-button:hover {
            background: linear-gradient(135deg, #ff4d4d, #e60000);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 77, 77, 0.4);
        }
        .home-button:active {
            transform: translateY(0);
        }
        .home-button::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 5px;
            height: 5px;
            background: rgba(255, 255, 255, 0.5);
            opacity: 0;
            border-radius: 100%;
            transform: scale(1, 1) translate(-50%, -50%);
            transform-origin: 50% 50%;
        }
        .home-button:focus:not(:active)::after {
            animation: ripple 1s ease-out;
        }
        @keyframes ripple {
            0% {
                transform: scale(0, 0);
                opacity: 0.5;
            }
            100% {
                transform: scale(20, 20);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="error-container">
      
        <h1><%= error.status || '错误' %></h1>
        <h2><%= message %></h2>
        <% if (error.stack && req.app.get('env') === 'development') { %>
            <div class="error-details">
                <pre><%= error.stack %></pre>
            </div>
        <% } %>
        <a href="/" class="home-button">返回首页</a>
    </div>
</body>
</html>